home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / faq / tg15demo.lha / TrekGuide.rexx < prev   
OS/2 REXX Batch file  |  1995-10-30  |  4KB  |  119 lines

  1. /*
  2.  Trek-The Guide Arexx Front End
  3.  ©1994-1995 Jim Hines All rights Reserved - - - - AmigaGuide Version
  4.  */
  5.  
  6. NL = '0a'x
  7.  
  8. if ~show('L','rexxsupport.library') then
  9.     call addlib('rexxsupport.library',0,-30)
  10. if ~show('L','rexxarplib.library') then
  11.     call addlib('rexxarplib.library',0,-30)
  12. /*if ~show('L','rexxreqtools.library') then
  13.     call addlib('rexxreqtools.library',0,-30)*/
  14.  
  15. if ~exists('env:Trekguide.prefs') then do
  16. call Request(100, 100,"ENV:Trekguide.prefs DOES NOT EXIST\You MUST create it by using the\TG-Screen program." ,, "Live Long and Prosper",,)
  17. exit
  18. end
  19.  
  20. /* This is the same as above but uses the RexxReqTools.library instead  */
  21. /*if ~exists('env:Trekguide.prefs') then do
  22.     call rtezrequest( "ENV:Trekguide.prefs DOES NOT EXIST" || NL || "You MUST create it by using"||NL||"the TG-Screen program.", " OK ", , )
  23.     exit
  24.     end*/
  25.  
  26. screenmode = open(sm, 'env:Trekguide.prefs', 'r')
  27. smvar = readln(sm)
  28. close(dfile)
  29. parse var smvar width '|' height
  30. say 'the width is 'width
  31. say 'the height is 'height
  32.  
  33.  
  34. call openport(notifyport)
  35. call openscreen(0, 4, hireslace, 'Trek-The.Guide ©1994-1995 Jim Hines', trekguide, , width, height, 0)
  36.  
  37. /* WORKBENCH COLORS */
  38.     Screencolor(trekguide, 0, 8, 8, 7)
  39.     Screencolor(trekguide, 1, 0, 0, 0)
  40.     Screencolor(trekguide, 2, 0, 15, 15)
  41.     Screencolor(trekguide, 3, 14, 14, 3)
  42.     Screencolor(trekguide, 4, 7, 7, 15)
  43.     Screencolor(trekguide, 5, 15, 15, 15)
  44.     Screencolor(trekguide, 6, 11, 10, 9)
  45.     Screencolor(trekguide, 7, 15, 11, 10)
  46.  
  47. /*  PIC COLORS */
  48.     Screencolor(trekguide, 8, 0, 0, 0)
  49.     Screencolor(trekguide, 9, 1, 1, 1)
  50.     Screencolor(trekguide, 10, 3, 3, 3)
  51.     Screencolor(trekguide, 11, 5, 5, 5)
  52.     Screencolor(trekguide, 12, 7, 7, 7)
  53.     Screencolor(trekguide, 13, 9, 9, 9)
  54.     Screencolor(trekguide, 14, 10, 10, 10)
  55.     Screencolor(trekguide, 15, 12, 12, 12)
  56.  
  57. address ARexx "'call CreateHost(hostport, notifyport, trekguide)'"
  58.  
  59. WaitForPort hostport
  60. WaitForPort hostport
  61. WaitForPort hostport
  62.  
  63. /* color = rtpaletterequest(, "Change palette", 'rt_pubscrname = trekguide')
  64. if rtresult == -1 then
  65.   call rtezrequest("You canceled." || NL || "No nice colors to be picked ?", ,
  66.         "Nah", , 'rt_pubscrname = trekguide' )
  67. else
  68.   call rtezrequest("You picked color number" color, "Sure did", , ) */
  69.  
  70. /* ========THESE DIRS & FILES PERTAIN TO THE MARK AND VIEW COMMANDS === */
  71.  
  72. address command 'makedir >nil: env:TrekGuide'
  73. if exists('envarc:TrekGuide') then do
  74.     address command    'copy envarc:TrekGuide all env:TrekGuide'
  75.     end
  76.  
  77. /* ========These section is for the opening IFF === */
  78.  
  79. idcmp = 'CLOSEWINDOW+GADGETUP'
  80. flags = 'BACKFILL+ACTIVATE'
  81.  
  82. address ARexx "'call CreateHost(hostport, notifyport, trekguide)'"
  83.  
  84. WaitForPort hostport
  85. WaitForPort hostport
  86.  
  87. call OpenWindow(hostport, 10, 10, 557, 364, idcmp, flags, 'PLEASE WAIT WHILE LOADING')
  88. call SetNotify(hostport, CLOSEWINDOW, hostport)
  89.  
  90. call IFFImage(hostport, 'TREKGUIDE:TREKPICS/OPENPIC', 5, 11, 561, 366, nocolor)
  91. closeport(hostport)
  92. call delay(200)
  93. call closewindow(hostport)
  94.  
  95.  
  96. /* ======== END IFF SECTION THEN LOAD MAIN GUIDE FILE ===*/
  97.  
  98. address command 'amigaguide TREKGUIDE:Trek-The.guide pubscreen TREKGUIDE'
  99.  
  100. /* ========= THIS SECTION IS FOR THE SAVING OF MARKED EPISODES === */
  101. number = FileList('ENV:TREKGUIDE/*', files, , N)
  102. if number = 0 then do 
  103.     call trekexit()
  104.     end
  105.  
  106. envfiles = Request(200, 50, 'Do you wish to save your\marked episodes for later?', , YES, NO, TREKGUIDE)
  107.     if envfiles = 'OKAY' then do
  108.     address command 'copy >nil: env:trekguide all envarc:TrekGuide'
  109.     end
  110.     else 
  111.     address command 'delete >NIL: envarc:TrekGuide all'
  112. /* ======== END OF MARKED EPISODES SECTION ===*/
  113.  
  114. trekexit:
  115. closescreen(trekguide)
  116. address command 'delete >NIL: env:TrekGuide all'
  117. address command 'avail flush >nil:' /* flushes the no longer needed libs from memory */
  118. exit
  119.